import {createSplash, initSplash} from './splash'
import {createApp, initApp} from './vonic'
import createStore from './createStore'
import createRoute from './route'

import utils from './utils'
import ajax from './ajax'

const App = class {

  constructor(options, callback) {
    this.app = null
    this.debug = options.debug || false
    this.splash = options.splash
    this.routes = options.routes
    this.store = options.store
    this.native = options.native
    this.callback = callback || null

    if(this.splash)
      this.createSplash()
    else
      this.createApp()
  }

  createSplash() {
    createSplash.call(this)
  }
  initSplash() {
    initSplash.call(this)
  }

  createApp() {
    createApp.call(this)
  }

  createStore() {
    createStore.call(this)
  }

  createRoute(routes) {
    return createRoute.call(this, routes)
  }

  initApp() {
    return initApp.call(this)
  }

}

export {
  utils,
  ajax
}

export default App
